<?php
include_once "xAP-functions/webincludes.php";

$sql="select Location,SourceID from xAP_Weather_Source where active=1 order by Location";
$results=dbquery($sql);

$body="<select name='sourceid'><option value='0'>All";
foreach($results as $value){
	$chk="";
	if(intval($extradata["sourceid"])>0){
		if (intval($extradata["sourceid"])==$value["SourceID"]){
			$chk=" SELECTED ";
		}
	}
	$body.="<option value='".$value["SourceID"]."'".$chk.">".$value["Location"];
}
$body.="</select>";

echo LayoutWidgetConfig("Select Source",$body,$widgetid);
?>